package com.cuit.springboot.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cuit.springboot.gdao.EnterpriseMapper;
import com.cuit.springboot.gentry.Enterprise;
import com.cuit.springboot.service.EnterpriseService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

@Service
public class EnterpriseServiceImpl implements EnterpriseService {

	@Autowired
	EnterpriseMapper enterpriseMapper;

	@Override
	public Page<Enterprise> findByPage(int pageNo, int pageSize) {
		PageHelper.startPage(pageNo, pageSize);
		return (Page<Enterprise>) enterpriseMapper.selectAll();

	}

	@Override
	public void insert(Enterprise enterprise) {
		enterpriseMapper.insert(enterprise);
	}

	@Override
	public Enterprise selectByOne(Integer id) {
		return enterpriseMapper.selectByPrimaryKey(id);
	}

}
